package com.example.springmvc_demo2.service;

import com.example.springmvc_demo2.entiry.UserEntiry;
import com.example.springmvc_demo2.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService {
    @Autowired
    private UserMapper userMapper;
    //登陆验证
    public UserEntiry login(UserEntiry userEntiry){
        //调用mapper层，通过用户输入的账号密码去查询数据库的信息
        userEntiry = userMapper.login(userEntiry);
        //如果账号密码正确，user对象不为空，则返回user对象，否则返回null
        return userEntiry;
    }
}